#include <iostream>
#include <string>
using namespace std;

//https://www.nowcoder.com/practice/bd891093881d4ddf9e56e7cc8416562d?tpId=182&tqId=34785&ru=/exam/oj

int main()
{
    string str;
    int maxLeft = 0, maxLen = 0;
    cin >> str;

    for (int left = 0; left < str.size(); left++)
    {
        if (str[left] >= '0' && str[left] <= '9')
        {
            int right = left;
            while (str[right] >= '0' && str[right] <= '9') right++;

            if (maxLen < right - left)
                maxLen = right - left, maxLeft = left;

            left = right;
        }
    }

    cout << str.substr(maxLeft, maxLen);

    return 0;
}
